package com.gg.tsj.controller;


import com.gg.common.pojo.SCell;
import com.gg.common.pojo.SGather;
import com.gg.common.pojo.SGatherDetails;
import com.gg.tsj.service.SGatherService;

import com.gg.tsj.vo.PageVo;
import com.gg.tsj.vo.SGatherVo;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;


@Controller
public class SGatherXiaotanController {

    @Resource
    private SGatherService sGatherService;

    @ResponseBody
    @RequestMapping("/saveSGatherXiaotan.action")
    public void saveSGatherXiaotan(@RequestBody SGatherVo vo) throws Exception {
        System.out.println(vo);
        this.sGatherService.saves(vo);
    }

    @ResponseBody
    @RequestMapping("/querySGatherXiaotan.action")
    public PageVo querySGatherXiaotan(PageVo vo) throws Exception {

        PageVo<SGather> sGatherPageSGatherVo = this.sGatherService.querySGather(vo);

        return sGatherPageSGatherVo;
    }

    @ResponseBody
    @RequestMapping("/queryBYIDXiaotan.action")
    public SGatherVo queryBYIDXiaotan(int id) throws Exception {


        return this.sGatherService.querySGatherDetails(id);
    }

    @ResponseBody
    @RequestMapping("/UpdateAuditXiatoan.action")
    public void UpdateAuditXiatoan(@RequestBody SGatherVo vo) throws Exception {
        System.out.println(vo);
        this.sGatherService.UpdateAudit(vo);
    }

    @ResponseBody
    @RequestMapping("/querySGatherPageXiaotan.action")
    public PageVo querySGatherPageXiaotan(PageVo<SGather> vo) throws Exception {

        return this.sGatherService.querySGatherPage(vo);
    }

    @ResponseBody
    @RequestMapping("/querySGatherPage_develop.action")
    public PageVo querySGatherPage_develop(PageVo<SGather> vo) throws Exception {

        return this.sGatherService.querySGatherPage_develop(vo);
    }

    @ResponseBody
    @RequestMapping("/queryByProductIdKey.action")
    public SCell queryByProductIdKey(String pid) throws Exception {
        System.out.println(pid);
        return this.sGatherService.queryByProductIdKey(pid);
    }

    @ResponseBody
    @RequestMapping("/updateS_GATHER_DETAILS.action")
    public void updateS_GATHER_DETAILS(int id) throws Exception {
        System.out.println(id);
        this.sGatherService.updateS_GATHER_DETAILS(id);
    }

    @ResponseBody
    @RequestMapping("/queryStorageXiaotan.action")
    public PageVo queryStorage(PageVo<SGather> vo) throws Exception {

        return this.sGatherService.queryStorage(vo);
    }

    @ResponseBody
    @RequestMapping("/updateSGatherDetailsQuantityOfThisTime.action")
    public void saveSGatherDetails(@RequestBody SGatherVo vo) throws Exception {
        this.sGatherService.updateSGatherDetailsQuantityOfThisTime(vo);
    }

    @ResponseBody
    @RequestMapping("/queryAuditXiaotan.action")
    public PageVo queryAudit(PageVo<SGather> vo) throws Exception {

        return this.sGatherService.queryAudit(vo);
    }

    @ResponseBody
    @RequestMapping("/updateSGatherDetailsGATHERED_AMOUNT.action")
    public void updateSGatherDetailsGATHERED_AMOUNT(@RequestBody SGatherVo vo) throws Exception {
        this.sGatherService.updateSGatherDetailsGATHERED_AMOUNT(vo);
    }
}
